StShadow *shadow_spec;
- CoglPipeline *text_shadow_material;
+ CoglPipeline *text_shadow_pipeline;
gfloat shadow_width;
gfloat shadow_height;
};
StEntry *entry = ST_ENTRY (object);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
}
if (!priv->shadow_spec || !shadow_spec ||
!st_shadow_equal (shadow_spec, priv->shadow_spec))
{
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
if (shadow_spec)
st_entry_update_hint_visibility (entry);
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
}
static void
st_entry_update_hint_visibility (entry);
/* Since the text changed, force a regen of the shadow texture */
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_TEXT]);
}
{
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
}
static void
clutter_actor_get_allocation_box (priv->entry, &allocation);
clutter_actor_box_get_size (&allocation, &width, &height);
- if (priv->text_shadow_material == NULL ||
+ if (priv->text_shadow_pipeline == NULL ||
width != priv->shadow_width ||
height != priv->shadow_height)
{
- CoglPipeline *material;
+ CoglPipeline *pipeline;
- g_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_pipeline);
- material = _st_create_shadow_pipeline_from_actor (priv->shadow_spec,
+ pipeline = _st_create_shadow_pipeline_from_actor (priv->shadow_spec,
priv->entry);
priv->shadow_width = width;
priv->shadow_height = height;
- priv->text_shadow_material = material;
+ priv->text_shadow_pipeline = pipeline;
}
- if (priv->text_shadow_material != NULL)
+ if (priv->text_shadow_pipeline != NULL)
{
_st_paint_shadow_with_opacity (priv->shadow_spec,
node,
- priv->text_shadow_material,
+ priv->text_shadow_pipeline,
&allocation,
clutter_actor_get_paint_opacity (priv->entry));
}
priv->spacing = 6.0f;
- priv->text_shadow_material = NULL;
+ priv->text_shadow_pipeline = NULL;
priv->shadow_width = -1.;
priv->shadow_height = -1.;
}
static CoglTexture *
-create_corner_material (StCornerSpec *corner)
+create_corner_pipeline (StCornerSpec *corner)
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
void *datap,
GError **error)
{
- return create_corner_material ((StCornerSpec *) datap);
+ return create_corner_pipeline ((StCornerSpec *) datap);
}
/* To match the CSS specification, we want the border to look like it was
StCorner corner_id)
{
CoglTexture *texture = NULL;
- CoglPipeline *material = NULL;
+ CoglPipeline *pipeline = NULL;
char *key;
StTextureCache *cache;
StCornerSpec corner;
if (texture)
{
- material = _st_create_texture_pipeline (texture);
+ pipeline = _st_create_texture_pipeline (texture);
g_object_unref (texture);
}
g_free (key);
- return material;
+ return pipeline;
}
static void
}
}
- state->corner_material[ST_CORNER_TOPLEFT] =
+ state->corner_pipeline[ST_CORNER_TOPLEFT] =
st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_TOPLEFT);
- state->corner_material[ST_CORNER_TOPRIGHT] =
+ state->corner_pipeline[ST_CORNER_TOPRIGHT] =
st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_TOPRIGHT);
- state->corner_material[ST_CORNER_BOTTOMRIGHT] =
+ state->corner_pipeline[ST_CORNER_BOTTOMRIGHT] =
st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_BOTTOMRIGHT);
- state->corner_material[ST_CORNER_BOTTOMLEFT] =
+ state->corner_pipeline[ST_CORNER_BOTTOMLEFT] =
st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_BOTTOMLEFT);
/* Use cairo to prerender the node if there is a gradient, or
}
static void
-paint_material_with_opacity (ClutterPaintNode *node,
- CoglPipeline *material,
+paint_pipeline_with_opacity (ClutterPaintNode *node,
+ CoglPipeline *pipeline,
ClutterActorBox *box,
ClutterActorBox *coords,
guint8 paint_opacity)
cogl_color_init_from_4f (&color,
paint_opacity / 255.0, paint_opacity / 255.0,
paint_opacity / 255.0, paint_opacity / 255.0);
- cogl_pipeline_set_color (material, &color);
+ cogl_pipeline_set_color (pipeline, &color);
- pipeline_node = clutter_pipeline_node_new (material);
+ pipeline_node = clutter_pipeline_node_new (pipeline);
clutter_paint_node_add_child (node, pipeline_node);
if (coords)
{
g_autoptr (ClutterPaintNode) corners_node = NULL;
- if (state->corner_material[corner_id] == NULL)
+ if (state->corner_pipeline[corner_id] == NULL)
continue;
- cogl_pipeline_set_color (state->corner_material[corner_id], &pipeline_color);
+ cogl_pipeline_set_color (state->corner_pipeline[corner_id], &pipeline_color);
corners_node =
- clutter_pipeline_node_new (state->corner_material[corner_id]);
+ clutter_pipeline_node_new (state->corner_pipeline[corner_id]);
clutter_paint_node_set_static_name (corners_node,
"StThemeNode (CSS border corners)");
clutter_paint_node_add_child (root, corners_node);
&allocation,
&paint_box);
- paint_material_with_opacity (root,
+ paint_pipeline_with_opacity (root,
state->prerendered_pipeline,
&paint_box,
NULL,
&background_box,
paint_opacity);
- paint_material_with_opacity (root,
+ paint_pipeline_with_opacity (root,
node->background_pipeline,
&background_box,
&texture_coords,
g_clear_object (&state->box_shadow_pipeline);
for (corner_id = 0; corner_id < 4; corner_id++)
- g_clear_object (&state->corner_material[corner_id]);
+ g_clear_object (&state->corner_pipeline[corner_id]);
if (unref_node)
st_theme_node_paint_state_set_node (state, NULL);
state->prerendered_pipeline = NULL;
for (corner_id = 0; corner_id < 4; corner_id++)
- state->corner_material[corner_id] = NULL;
+ state->corner_pipeline[corner_id] = NULL;
}
void
if (other->prerendered_pipeline)
state->prerendered_pipeline = g_object_ref (other->prerendered_pipeline);
for (corner_id = 0; corner_id < 4; corner_id++)
- if (other->corner_material[corner_id])
- state->corner_material[corner_id] = g_object_ref (other->corner_material[corner_id]);
+ if (other->corner_pipeline[corner_id])
+ state->corner_pipeline[corner_id] = g_object_ref (other->corner_pipeline[corner_id]);
}
void
CoglFramebuffer *old_offscreen;
CoglFramebuffer *new_offscreen;
- CoglPipeline *material;
+ CoglPipeline *pipeline;
ClutterTimeline *timeline;
guint width, height;
GError *catch_error = NULL;
- /* template material to avoid unnecessary shader compilation */
- static CoglPipeline *material_template = NULL;
+ /* template pipeline to avoid unnecessary shader compilation */
+ static CoglPipeline *pipeline_template = NULL;
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
width = ceilf ((priv->offscreen_box.x2 - priv->offscreen_box.x1) * resource_scale);
return FALSE;
}
- if (priv->material == NULL)
+ if (priv->pipeline == NULL)
{
- if (G_UNLIKELY (material_template == NULL))
+ if (G_UNLIKELY (pipeline_template == NULL))
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
- material_template = cogl_pipeline_new (ctx);
+ pipeline_template = cogl_pipeline_new (ctx);
- cogl_pipeline_set_layer_combine (material_template, 0,
+ cogl_pipeline_set_layer_combine (pipeline_template, 0,
"RGBA = REPLACE (TEXTURE)",
NULL);
- cogl_pipeline_set_layer_combine (material_template, 1,
+ cogl_pipeline_set_layer_combine (pipeline_template, 1,
"RGBA = INTERPOLATE (PREVIOUS, "
"TEXTURE, "
"CONSTANT[A])",
NULL);
- cogl_pipeline_set_layer_combine (material_template, 2,
+ cogl_pipeline_set_layer_combine (pipeline_template, 2,
"RGBA = MODULATE (PREVIOUS, "
"PRIMARY)",
NULL);
}
- priv->material = cogl_pipeline_copy (material_template);
+ priv->pipeline = cogl_pipeline_copy (pipeline_template);
}
- cogl_pipeline_set_layer_texture (priv->material, 0, priv->new_texture);
- cogl_pipeline_set_layer_texture (priv->material, 1, priv->old_texture);
+ cogl_pipeline_set_layer_texture (priv->pipeline, 0, priv->new_texture);
+ cogl_pipeline_set_layer_texture (priv->pipeline, 1, priv->old_texture);
noop_pipeline = cogl_pipeline_new (ctx);
cogl_framebuffer_orthographic (priv->old_offscreen,
cogl_color_init_from_4f (&constant, 0., 0., 0.,
clutter_timeline_get_progress (priv->timeline));
- cogl_pipeline_set_layer_combine_constant (priv->material, 1, &constant);
+ cogl_pipeline_set_layer_combine_constant (priv->pipeline, 1, &constant);
cogl_color_init_from_4f (&pipeline_color,
paint_opacity / 255.0, paint_opacity / 255.0,
paint_opacity / 255.0, paint_opacity / 255.0);
- cogl_pipeline_set_color (priv->material, &pipeline_color);
+ cogl_pipeline_set_color (priv->pipeline, &pipeline_color);
- pipeline_node = clutter_pipeline_node_new (priv->material);
+ pipeline_node = clutter_pipeline_node_new (priv->pipeline);
clutter_paint_node_add_child (node, pipeline_node);
clutter_paint_node_add_multitexture_rectangle (pipeline_node,
&priv->offscreen_box,
g_clear_object (&priv->old_offscreen);
g_clear_object (&priv->new_offscreen);
- g_clear_object (&priv->material);
+ g_clear_object (&priv->pipeline);
if (priv->timeline)
{
CoglPipeline *box_shadow_pipeline;
CoglTexture *prerendered_texture;
CoglPipeline *prerendered_pipeline;
- CoglPipeline *corner_material[4];
+ CoglPipeline *corner_pipeline[4];
};
StThemeNode *st_theme_node_new (StThemeContext *context,